from random import randint

# random.randint(a, b),Return a random integer N such that a <= N <= b

ip1 = str(randint(1,255))
ip2 = str(randint(1,255))
ip3 = str(randint(1,255))
ip4 = str(randint(1,255))


print(ip1,ip2,ip3,ip4,sep='.')

print('随机IP地址为:',ip1 + '.' + ip2 + '.' + ip3 + '.' + ip4)


7.114.212.190
随机IP地址为:.7.114.212.190